package service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import entity.Comment;
import entity.CommentExample;

import dao.CommentMapper;

@Service
public class CommentServiceImpl implements CommentService {
	@Autowired
	CommentMapper commentMapper;
	
	@Override
	public List<Comment> All() {
		CommentExample example=new CommentExample();
		example.setOrderByClause("time desc");
		List<Comment> comment = commentMapper.selectByExample(example);
		return commentMapper.selectByExample(example);
	}

	@Override
	public int del(int cid) {
		return commentMapper.deleteByPrimaryKey(cid);
	}

}
